package com.imooc.base

object Test {
  def main(args: Array[String]): Unit = {

    val s = "+and to adopt it for the collected chronicles of the Forsyte family has indulged the Forsytean tenacity that is in all of us"
    val words = s.split(" ")

    val p = "^[a-zA-Z0-9]+$".r
    //    words.map(x=>p.findAllIn(x).toArray).map(x=>println(x))
        words.map(x=>p.findAllIn(x).toArray).flatten.map(x=>println(x))
//        words.map(x=>p.findAllIn(x).toArray).flatten.mkString

  }

}
